package com.yonyou.cyxdms.basedata.service.dto;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.yonyou.cyx.framework.bean.dto.base.BaseDTO;
import com.yonyou.cyx.framework.bean.entity.base.BasePO;
import com.yonyou.cyx.function.utils.bean.BeanMapperUtil;
import com.yonyou.cyx.function.utils.jsonserializer.localdatetime.JsonLocalDateTimeDeserializer;
import com.yonyou.cyx.function.utils.jsonserializer.localdatetime.JsonLocalDateTimeSerializer;

import java.io.Serializable;
import java.time.LocalDateTime;


/**
 * <p>
 * 产品表
 * </p>
 *
 * @author guorp1
 * @since 2018-11-12
 */

public class ProductDTO extends BaseDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 整车产品_ID
     */
    private Long productId;
    /**
     * 产品代码
     */
    private String productCode;
    /**
     * 产品名称
     */
    private String productName;
    /**
     * 配置ID
     */
    private Long packageId;
    /**
     * 颜色代码
     */
    private String color;
    /**
     * 颜色名称
     */
    private String colorName;
    /**
     * 正常，退市 正常: 14081001 退市:14081002
     */
    private Integer productStatus;
    /**
     * 是，否  是：10041001 否：10041002
     */
    private Integer isValid;
    /**
     * 车厂指导价
     */
    private Double oemDirectiveprice;
    /**
     * 销售指导价
     */
    private Double directivePrice;
    /**
     * 上市日期
     */
    @JsonDeserialize(using = JsonLocalDateTimeDeserializer.class)
    @JsonSerialize(using = JsonLocalDateTimeSerializer.class)
    private LocalDateTime enterDate;
    /**
     * 退市日期
     */
    @JsonDeserialize(using = JsonLocalDateTimeDeserializer.class)
    @JsonSerialize(using = JsonLocalDateTimeSerializer.class)
    private LocalDateTime exeuntdate;
    /**
     * 备注
     */
    private String remark;
    /**
     * 时间戳
     */
    @JsonDeserialize(using = JsonLocalDateTimeDeserializer.class)
    @JsonSerialize(using = JsonLocalDateTimeSerializer.class)
    private LocalDateTime changedAt;
    /**
     * 物料价格
     */
    private Double vhclPrice;
    /**
     * 物料加价
     */
    private Double addPrice;
    /**
     * 最近价格
     */
    private Double minPrice;
    /**
     * 内饰代码
     */
    private String trimCode;
    /**
     * 内饰颜色名称
     */
    private String trimColorName;
    /**
     * 来源业务ID
     */
    private Long sourceId;
    /**
     * 来源渠道
     */
    private Integer sourceChannel;
    @JsonDeserialize(using = JsonLocalDateTimeDeserializer.class)
    @JsonSerialize(using = JsonLocalDateTimeSerializer.class)
    private LocalDateTime sourceChangedAt;
    /**
     * 是否删除
     */
    private Integer isDeleted;
    /**
     * 创建日期
     */
    @JsonDeserialize(using = JsonLocalDateTimeDeserializer.class)
    @JsonSerialize(using = JsonLocalDateTimeSerializer.class)
    private LocalDateTime createdTime;
    /**
     * 更新日期
     */
    @JsonDeserialize(using = JsonLocalDateTimeDeserializer.class)
    @JsonSerialize(using = JsonLocalDateTimeSerializer.class)
    private LocalDateTime updatedTime;

    private Integer method;

    private String bizId;

    public ProductDTO() {
        super();
    }


    public Long getProductId() {
        return productId;
    }


    public void setProductId(Long productId) {
        this.productId = productId;
    }


    public String getProductCode() {
        return productCode;
    }


    public void setProductCode(String productCode) {
        this.productCode = productCode;
    }


    public String getProductName() {
        return productName;
    }


    public void setProductName(String productName) {
        this.productName = productName;
    }


    public Long getPackageId() {
        return packageId;
    }


    public void setPackageId(Long packageId) {
        this.packageId = packageId;
    }


    public String getColor() {
        return color;
    }


    public void setColor(String color) {
        this.color = color;
    }


    public String getColorName() {
        return colorName;
    }


    public void setColorName(String colorName) {
        this.colorName = colorName;
    }


    public Integer getProductStatus() {
        return productStatus;
    }


    public void setProductStatus(Integer productStatus) {
        this.productStatus = productStatus;
    }


    public Integer getIsValid() {
        return isValid;
    }


    public void setIsValid(Integer isValid) {
        this.isValid = isValid;
    }


    public Double getOemDirectiveprice() {
        return oemDirectiveprice;
    }


    public void setOemDirectiveprice(Double oemDirectiveprice) {
        this.oemDirectiveprice = oemDirectiveprice;
    }


    public Double getDirectivePrice() {
        return directivePrice;
    }


    public void setDirectivePrice(Double directivePrice) {
        this.directivePrice = directivePrice;
    }


    public LocalDateTime getEnterDate() {
        return enterDate;
    }


    public void setEnterDate(LocalDateTime enterDate) {
        this.enterDate = enterDate;
    }


    public LocalDateTime getExeuntdate() {
        return exeuntdate;
    }


    public void setExeuntdate(LocalDateTime exeuntdate) {
        this.exeuntdate = exeuntdate;
    }


    public String getRemark() {
        return remark;
    }


    public void setRemark(String remark) {
        this.remark = remark;
    }


    public LocalDateTime getChangedAt() {
        return changedAt;
    }


    public void setChangedAt(LocalDateTime changedAt) {
        this.changedAt = changedAt;
    }


    public Double getVhclPrice() {
        return vhclPrice;
    }


    public void setVhclPrice(Double vhclPrice) {
        this.vhclPrice = vhclPrice;
    }


    public Double getAddPrice() {
        return addPrice;
    }


    public void setAddPrice(Double addPrice) {
        this.addPrice = addPrice;
    }


    public Double getMinPrice() {
        return minPrice;
    }


    public void setMinPrice(Double minPrice) {
        this.minPrice = minPrice;
    }


    public String getTrimCode() {
        return trimCode;
    }


    public void setTrimCode(String trimCode) {
        this.trimCode = trimCode;
    }


    public String getTrimColorName() {
        return trimColorName;
    }


    public void setTrimColorName(String trimColorName) {
        this.trimColorName = trimColorName;
    }


    public Long getSourceId() {
        return sourceId;
    }


    public void setSourceId(Long sourceId) {
        this.sourceId = sourceId;
    }


    public Integer getSourceChannel() {
        return sourceChannel;
    }


    public void setSourceChannel(Integer sourceChannel) {
        this.sourceChannel = sourceChannel;
    }

    public Integer getMethod() {
        return method;
    }

    public void setMethod(Integer method) {
        this.method = method;
    }

    public String getBizId() {
        return bizId;
    }

    public void setBizId(String bizId) {
        this.bizId = bizId;
    }

    public LocalDateTime getSourceChangedAt() {
        return sourceChangedAt;
    }


    public void setSourceChangedAt(LocalDateTime sourceChangedAt) {
        this.sourceChangedAt = sourceChangedAt;
    }


    public Integer getIsDeleted() {
        return isDeleted;
    }


    public void setIsDeleted(Integer isDeleted) {
        this.isDeleted = isDeleted;
    }


    public LocalDateTime getCreatedTime() {
        return createdTime;
    }


    public void setCreatedTime(LocalDateTime createdTime) {
        this.createdTime = createdTime;
    }


    public LocalDateTime getUpdatedTime() {
        return updatedTime;
    }


    public void setUpdatedTime(LocalDateTime updatedTime) {
        this.updatedTime = updatedTime;
    }


    @Override
    public String toString() {
        return "ProductDTO{" +
                "productId=" + productId +
                ", productCode='" + productCode + '\'' +
                ", productName='" + productName + '\'' +
                ", packageId=" + packageId +
                ", color='" + color + '\'' +
                ", colorName='" + colorName + '\'' +
                ", productStatus=" + productStatus +
                ", isValid=" + isValid +
                ", oemDirectiveprice=" + oemDirectiveprice +
                ", directivePrice=" + directivePrice +
                ", enterDate=" + enterDate +
                ", exeuntdate=" + exeuntdate +
                ", remark='" + remark + '\'' +
                ", changedAt=" + changedAt +
                ", vhclPrice=" + vhclPrice +
                ", addPrice=" + addPrice +
                ", minPrice=" + minPrice +
                ", trimCode='" + trimCode + '\'' +
                ", trimColorName='" + trimColorName + '\'' +
                ", sourceId=" + sourceId +
                ", sourceChannel=" + sourceChannel +
                ", sourceChangedAt=" + sourceChangedAt +
                ", isDeleted=" + isDeleted +
                ", createdTime=" + createdTime +
                ", updatedTime=" + updatedTime +
                ", method=" + method +
                ", bizId='" + bizId + '\'' +
                '}';
    }

    /**
     * 将DTO 转换为PO
     * //对某个对象属性进行赋值
     * //BeanMapperUtil.populateValueByMethod(transPO,"setXxx",this.getXxx);
     *
     * @param poClass dto 需要转换的dto
     * @author guorp1
     * @since 2018/7/22 0022
     */
    @Override
    public <T extends BasePO> T transDtoToPo(Class<T> poClass) {
        return super.transDtoToPo(poClass);
    }

    /**
     * 将DTO 转换为PO
     * BeanMapperUtil.populateValueByMethod(transPO,"setXxx",this.getXxx);
     *
     * @param po 需要转换的对象
     * @author guorp1
     * @since 2018/7/22 0022
     */
    public <T extends BasePO> void transDtoToPo(T po) {
        BeanMapperUtil.copyProperties(this, po, "productId");
    }

}
